home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_11_pyr_kidvsindy_2.cog < prev    next >
Text File  |  1999-11-15  |  35KB  |  1,331 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 11_PYR_KidVsIndy_2.cog
  4. #
  5. # Indy must do business with Nubian Kid
  6. #
  7. # [HB]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12.  
  13. symbols
  14.  
  15. # .................................. MESSAGES ..................................
  16.  
  17.     message        startup
  18.     message        entered
  19.     message        exited
  20.     message        activated
  21.     message        callback
  22.     message        pulse
  23.     
  24. # .................................. KEYFRAMES .................................
  25.     
  26.     keyframe    in_pushHat=0in_figithat_4_4.key            local
  27.     keyframe    in_botharmsup=0in_armsup_1_1.key        local
  28.     keyframe    in_ltarmup=0in_leftarm_1_1.key            local
  29.  
  30.     keyframe    in_armsCrossed=0in_stand2.key            local
  31.     keyframe    in_handsONhips=0in_stand4.key            local
  32.     keyframe    in_crossArms=0in_stand1_bd_2.key           local
  33.     keyframe    in_handsTOhips=0in_stand1_bd_4.key           local
  34.     keyframe    in_displaywatch=0in_holdwatchup_1_1.key    local
  35.     keyframe    in_givewatch=0in_givewatch_1_1.key        local # mark not used
  36.     keyframe    in_takegem=0in_takeobj_1_1.key            local # marked @ x72/cb22
  37.  
  38.     keyframe    nu_handsTOhips=0by_stand1_bd_2.key        local
  39.     keyframe    nu_handsONhips=0by_stand2_handsonhip.key    local
  40.     keyframe    nu_handsTOside=0by_stand2_bd_1.key        local
  41.     keyframe    nu_reachforwatch=0by_jumpup_1_1.key        local
  42.     keyframe    nu_scramble=0by_climb.key                local
  43.     keyframe    nu_scramwatch=0by_climb_w_watch.key        local
  44.     keyframe    nu_wearwatch=0by_watchgesture1_1.key    local
  45.     keyframe    nu_railslow=0by_walk_rail.key            local
  46.     keyframe    nu_grabgem=0by_getjewel.key                local # marked @ x18/cb21
  47.     keyframe    nu_getwatch=0by_getwatch_1_1.key        local # marked @ x30/cb21
  48.     keyframe    nu_givegem=0by_givecrystal_1_1.key        local # marked @ x20/cb21
  49.     keyframe    nu_industry=0by_triumphant_1_1.key        local
  50.     keyframe    nu_factory=0by_points_1_1.key            local
  51.             
  52. # .................................. MODELS ....................................
  53.         
  54.     model          mod_in_watchhand=hand_in_watch.3do        local
  55.     model          mod_in_gemhand=hand_in_gem.3do            local
  56.     model          mod_nu_watchhand=hand_by_watch.3do        local
  57.     model          mod_nu_gemhand=hand_by_gem.3do            local
  58.             
  59. # .................................. SOUNDS ....................................
  60.  
  61.     # Lines for intro...
  62.     sound        in_sayline=pr07j01.wav                    local # [0]--> "...balance on rail"
  63.     sound        in_whatthere=Inxj228.wav                local # "What's that over there?"
  64.     sound        in_somethere=Inxj230.wav                local # "Something...what is it?"
  65.     sound        in_heything=Inxj231.wav                    local # "Hey, something's over there."
  66.  
  67.     # Lines for encounter 1...
  68.     sound        nu_thanks=pr08b01.wav                    local
  69.     sound        in_american=pr08j02.wav                    local
  70.     sound        nu_civilized=pr08b03.wav                local
  71.     sound        in_toosure=pr08j04.wav                    local
  72.     sound        nu_industrialized=pr08b05.wav            local
  73.     sound        in_helpme=pr08j06.wav                    local
  74.     sound        nu_chaphorner=pr08b07.wav                local
  75.     sound        in_myth=pr08j08.wav                        local
  76.     sound        nu_ineed=pr08b09.wav                    local
  77.     sound        in_miracles=pr08j10.wav                    local
  78.     sound        nu_observed=pr08b11.wav                    local
  79.     sound        in_sorrykid=pr08j12.wav                    local
  80.     sound        nu_illwait=pr08b13.wav                    local
  81.  
  82.     # Lines for encounter 2...
  83.     sound        in_youagain=pr08j14.wav                    local
  84.     sound        nu_helloamerican=pr08b15.wav            local
  85.     sound        in_nowatch=pr08j16.wav                    local
  86.     sound        nu_andyoucall=pr08b17.wav                local
  87.  
  88.     # Lines for encounter 3...
  89.     sound        nu_mywatch=pr08b18.wav                    local
  90.     sound        in_cantfind=pr08j19.wav                    local
  91.     sound        nu_donteventry=pr08b20.wav                local
  92.  
  93.     # Lines for exchange...
  94.     sound        nu_ahhhh=pr11b04.wav                    local
  95.     sound        in_notsofast=pr11j05.wav                local
  96.     sound        in_goodcare=pr11j06.wav                    local
  97.     sound        nu_nowiown=pr11b07.wav                    local
  98.     sound        in_astart=pr11j08.wav                    local
  99.     sound        nu_kenya=pr11b09.wav                    local
  100.  
  101.     # Music bits
  102.     sound        glintmusic=mus_pyr_shinyobject.wav        local
  103.     sound        kidmusic=mus_pyr_nubianboy.wav            local
  104.  
  105.     # SFX
  106.     sound        rattle=pyr_conveyor_move.wav    local
  107.  
  108. # ............................... ACTOR THINGS .................................
  109.  
  110.     thing        player                                    local
  111.     thing        indy                                    linkid=0
  112.     thing        nukid
  113.  
  114. # .............................. OBJECT THINGS .................................
  115.  
  116.     thing        gem
  117.     thing        sparkle                                    nolink
  118.     thing        badpost                                    nolink
  119.  
  120. # .............................. CAMERA THINGS .................................
  121.  
  122.     thing        cam_1                                    nolink
  123.     thing        cam_2                                    nolink
  124.     thing        cam_3                                    nolink
  125.     thing        cam_4                                    nolink
  126.     thing        cam_5                                    nolink
  127.     thing        cam_6                                    nolink
  128.     thing        cam_7                                    nolink
  129.     thing        cam_8                                    nolink
  130.     thing        cam_9                                    nolink
  131.     thing        cam_10                                    nolink
  132.     thing        cam_11                                    nolink
  133.     thing        cam_12                                    nolink
  134.     thing        cam_13                                    nolink
  135.     thing        cam_14                                    nolink
  136.     thing        cam_15                                    nolink
  137.     thing        cam_16                                    nolink
  138.     thing        cam_17                                    nolink
  139.     thing        cam_18                                    nolink
  140.     thing        cam_19                                    nolink
  141.  
  142.     thing        ct_1                                    nolink
  143.     thing        ct_2                                    nolink
  144.     thing        ct_3                                     nolink
  145.     thing        ct_4                                    nolink
  146.     thing        ct_5                                    nolink
  147.     thing        ct_6                                    nolink
  148.     thing        ct_7                                    nolink
  149.     thing        ct_8                                    nolink
  150.     thing        ct_9                                    nolink
  151.     thing        ct_10                                    nolink
  152.     thing        ct_11                                    nolink
  153.     thing        ct_12                                    nolink
  154.     thing        ct_13                                    nolink
  155.     thing        ct_14                                    nolink
  156.     thing        ct_15                                    nolink
  157.  
  158.     thing        cam1spot                                local
  159.     thing        cam1look                                local
  160.     
  161. # .............................. TARGET THINGS .................................
  162.  
  163.     thing        in_mk_1                                    nolink
  164.     thing        in_mk_2                                    nolink
  165.     thing        in_mk_3                                    nolink
  166.  
  167.     thing        nu_mk_1                                    nolink
  168.     thing        nu_mk_2                                    nolink
  169.     thing        nu_mk_3                                    nolink
  170.     thing        nu_mk_4                                    nolink
  171.     thing        nu_mk_5                                    nolink
  172.     thing        nu_mk_6                                    nolink
  173.     thing        nu_mk_7a                                nolink
  174.     thing        nu_mk_7b                                nolink
  175.     thing        nu_mk_8a                                nolink
  176.     thing        nu_mk_8b                                nolink
  177.     thing        nu_mk_9                                    nolink
  178.     thing        nu_mk_10                                nolink
  179.     thing        nu_mk_11                                nolink
  180.  
  181. # ............................... VAR THINGS ...................................
  182.  
  183.     thing        indyCamTarget                            local # created on fly
  184.     thing        kidCamTarget                            local # created on fly
  185.     thing        whichcam                                local # var
  186.     thing        entercam                                local # var
  187.     thing        looker                                    local # var
  188.     thing        lookee                                    local # var
  189.  
  190. # ........................ OTHER ENGINE REFERENCES .............................
  191.             
  192.     cog            caveincog
  193.  
  194.     sector        replaysector
  195.     sector        targetsector                            local # var
  196.  
  197.     surface        startkid                        
  198.     surface        resetface
  199.     surface        replayface
  200.     surface        railface
  201.  
  202.     material    sparkmat
  203.  
  204.     template    tpl_ghost=ghost                            local
  205.     
  206. # ............................... VARIABLES ....................................
  207.     
  208.     vector        v_targetpos                                local
  209.  
  210.     flex        in_rotRate                                local
  211.     flex        nu_rotRate                                local
  212.     flex        viewangle                                local
  213.  
  214.     int            cutSceneState=0                            local # overall state var
  215.     int            cluetalk=0                                local # governs Indy comments
  216.     int            playergone=0                            local # allows suicide plunges
  217.     int            preventscene=0                            local # stops bad repeats
  218.     int            alreadyworking=0                        local # stops multiple starts
  219.     int            camexists=0                                local # limits thing creation
  220.  
  221.     int            oldline                                    local
  222.     int            newline                                    local
  223.  
  224.     int            in_keyTrack1                            local
  225.     int            nu_keyTrack1                            local
  226.     int            nu_keyTrack2                            local
  227.  
  228.     int            in_swapItem1                            local
  229.     int            in_swapItem2                            local
  230.     int            nu_swapItem1                            local
  231.     int            nu_swapItem2                            local
  232.     int            swapevent=0                                local
  233.             
  234.     int            sender                                    local
  235.     int            source                                    local
  236.     int            curSound                                local
  237.     int            curSound2                                local
  238.     int            curCam                                    local
  239.  
  240.     int            gemeye=65                                local # define
  241.     int            hornerwatch=100                            local # define
  242.  
  243. # subroutines
  244. flex    replayintro=0.0        local
  245. flex    firstvisit=0.0        local
  246. flex    secondvisit=0.0        local
  247. flex    thirdvisit=0.0        local
  248. flex    nukidenter=0.0        local
  249. flex    nukidexit=0.0        local
  250. flex    exchange=0.0        local
  251. flex    generalprep=0.0        local
  252. flex    backtoplay=0.0        local
  253. flex    randcluelines=0.0    local
  254. flex    firstintro=0.0        local
  255. end
  256.  
  257. # ==============================================================================
  258.  
  259. code
  260.  
  261. # ..............................................................................
  262.  
  263. startup:
  264.  
  265. //Print("----MOVIECOG START----");
  266.     
  267.     # Pointer to Player...
  268.     player = GetLocalPlayerThing();
  269.  
  270.     # Prep...
  271. //    curCam = GetCurrentCamera();
  272. //    viewangle = GetCameraFOV();
  273.     SetThingFlags(indy, 0x80000);
  274.     SetThingFlags(nukid, 0x80000);
  275.     in_rotRate = GetThingMaxRotVel(indy);
  276.     nu_rotRate = GetThingMaxRotVel(nukid);
  277.     SetAdjoinFlags(railface, 0x02);
  278.  
  279.     return;
  280.  
  281. # ..............................................................................
  282.  
  283. entered:
  284.     
  285. //Print("halcog entered-->");
  286.  
  287.     # NOTES:
  288.     #
  289.     # cutSceneState-->    corresponds to 7 cutscene states:
  290.     # 0. Indy has yet to notice the sparkle
  291.     # 1. Indy has yet to talk to kid
  292.     # 2. Indy has talked to kid once
  293.     # 3. Indy has talked to kid twice
  294.     # 4. Indy has talked to kid at least three times
  295.     # 5. Indy has watch but has yet to exchange it for gemeye
  296.     # 6. Indy has gemeye at last!
  297.     
  298.     sender = GetSenderRef();
  299.     source = GetSourceRef();
  300.  
  301.     # moved from startup to avoid crash -- RKD
  302.     curCam = GetCurrentCamera();
  303.     viewangle = GetCameraFOV();
  304.  
  305.     playergone = 0; # reset every entry
  306.  
  307.     if (sender == resetface)
  308.     {
  309.         # Reset semaphor...
  310.         preventscene = 0;
  311.         return;
  312.     }
  313.  
  314.     if (alreadyworking == 1)
  315.     {
  316.         # No multiple starts...
  317.         return;
  318.     }
  319.  
  320.     if (sender != startkid && sender != replayface)
  321.     {
  322.         # General filter...
  323.         return;
  324.     }
  325.  
  326.     if (source != player)
  327.     {
  328.         # Abort if triggering event wasn't Indy...
  329.         return;
  330.     }
  331.  
  332.     if (cutSceneState == 6)
  333.     {
  334.         # Abort if Indy already has the gemeye...
  335.         return;
  336.     }
  337.  
  338.     if (sender == startkid && cutSceneState > 0)
  339.     {
  340.         # Abort from this sender if firstintro has already played...
  341.         return;
  342.     }
  343.  
  344.     if (sender == replayface && preventscene > 0)
  345.     {
  346.         # Don't re-trigger scene involuntarily unless Indy has moved away meanwhile...
  347.         return;
  348.     }
  349.  
  350.     if (sender == replayface)
  351.     {
  352.         Sleep(0.8);
  353.         if (playergone == 1)
  354.         {
  355.             # Abort if Indy dodges in and out (see exited code)...
  356.             return;
  357.         }
  358.     }
  359.  
  360. //Print("moviecog entered-->");
  361.  
  362.     call generalprep;
  363.     
  364.     #### TEST STATE...
  365. //    PRINT("BUG: COG THINKS ALL HYENAS ARE DEAD");
  366. //    GLOBAL8 = 11;
  367.  
  368.     #### TEST STATEMENT...
  369.     ####if (cutSceneState > 0)
  370.  
  371.     if (cutSceneState > 1 && GetInv(player, hornerwatch) == 1)
  372.     {
  373.         # Detect for watch externally only after Indy has already met kid...
  374.         cutSceneState = 5;
  375.     }
  376.     
  377.     if (cutSceneState > 0)
  378.     {
  379.         call replayintro;
  380.     }
  381.     else
  382.     {
  383.         call firstintro;
  384.     }
  385.  
  386.     call backtoplay;
  387.  
  388.     return;
  389.  
  390. # ..............................................................................
  391.  
  392. activated:
  393.     
  394.     if (cutSceneState == 6)
  395.     {
  396.         # Abort if Indy already has the gemeye...
  397.         return;
  398.     }
  399.     
  400.     if (GetSenderRef() == replayface)
  401.     {
  402.         call generalprep;
  403.     
  404.         #### TEST STATE...
  405.         //PRINT("BUG: COG THINKS ALL HYENAS ARE DEAD");
  406.         #### GLOBAL8 = 11;
  407.         
  408.         #### TEST STATEMENT...
  409.         ####if (cutSceneState > 0)
  410.  
  411.         if (cutSceneState > 1 && GetInv(player, hornerwatch) == 1)
  412.         {
  413.             # Detect for watch externally only after Indy has already met kid...
  414.             cutSceneState = 5;
  415.         }
  416.  
  417.         call replayintro;
  418.  
  419.         whichcam = cam_2;
  420.         call backtoplay;
  421.     }
  422.     
  423.     return;
  424.  
  425. # ..............................................................................
  426.  
  427. exited:
  428.  
  429.     if (GetSenderRef() == replaysector)
  430.     {
  431.         playergone = 1;
  432.     }
  433.     
  434.     return;
  435.     
  436. # ..............................................................................
  437.  
  438. firstintro:
  439.     
  440.     # Prep...
  441.     cutSceneState = 1;
  442.     preventscene = 1; # no quick repeats
  443.  
  444.     # Turn off future saylines at mine tunnel cave-in...
  445.     SendMessage(caveincog, user1);
  446.     
  447.     # Establish a target near Indy...
  448.     v_targetpos = VectorAdd(VectorTransformToOrient(indy, '0.0 0.05 0.0'), GetThingPos(indy));    
  449.     targetsector = FindNewSectorFromThing(indy, v_targetpos);
  450.     indyCamTarget =
  451.         CreateThingAtPos(tpl_ghost, targetsector, v_targetpos, '0 0 0');
  452.     CaptureThing(indyCamTarget); # no capture, no work
  453.     AttachThingToThing(indyCamTarget, indy); # track his move
  454.     
  455.     # Cut to long shot of Indy...
  456.     SetCameraLookInterp(2, 0);
  457.     SetCameraPosInterp(2, 0);
  458.     SetCameraFocus(2, cam_1);
  459.     SetCameraSecondaryFocus(2, indyCamTarget);
  460.     SetCurrentCamera(2);
  461.     SetCameraFOV(65, 0, 0.0);
  462.  
  463.     # Walk Indy to the edge of the trestle...
  464.     AISetMoveSpeed(indy, 1.1);
  465.     AISetLookThing(indy, in_mk_1);
  466.     AISetMoveThing(indy, in_mk_1, 0);
  467.     AIWaitForStop(indy);
  468.     AISetLookThing(indy, gem);
  469.  
  470.     # Pan to watch Indy stare across at the tunnel...
  471.     PlaySoundLocal(glintmusic, .6, 0, 0, 0);
  472.     AISetLookThing(indy, gem);
  473.     SetCameraLookInterp(2, 1);
  474.     SetCameraPosInterp(2, 1);
  475.     SetCameraInterpSpeed(2, 2.5);
  476.     Sleep(0.01);
  477.     SetCameraFocus(2, cam_2);
  478.     SetCameraSecondaryFocus(2, ct_1);
  479.     SetCameraFOV(80, 1, 2.5);
  480.     Sleep(0.7);
  481.         
  482.     # Indy sees the sparkle...
  483.     SetMaterialCel(sparkmat, 0);
  484.     AnimateSpriteSize(sparkle, '0.01 0.01 0.0', '0.2 0.2 1.0', .25);
  485.     MaterialAnim(sparkmat, 20, 1);
  486.     Sleep(0.5);
  487.     AnimateSpriteSize(sparkle, '0.2 0.2 1.0', '0.01 0.01 0.0', .25);
  488.     Sleep(0.25);
  489.  
  490.     # Indy: "There's something over there, but...rail..."
  491.     curSound = PlayVoice(indy, in_sayline[0], 1, 0);
  492.     WaitForSound(curSound);
  493.  
  494.     whichcam = cam_1; # in case of early return
  495.  
  496.     # Kid will not appear until hyenas are gone...
  497.     if (global8 >= 11)
  498.     {
  499.         call firstvisit;
  500.     }
  501.  
  502.     # Housekeeping...
  503.     DestroyThing(indyCamTarget); # its work is done
  504.     SetCameraPosition(1, GetThingPos(whichcam));
  505.     SetCurrentCamera(curCam);
  506.     RestoreExtCam();
  507.  
  508.     return;
  509.  
  510. # ..............................................................................
  511.  
  512. replayintro:
  513.  
  514.     if (IsThingVisible(gem) == 0)
  515.     {
  516.         # Abort if Indy is looking in the wrong direction...
  517.         return;
  518.     }
  519.  
  520.     # Aim Indy...
  521.     AISetLookThing(indy, gem);
  522.     AIWaitForStop(indy);
  523.  
  524.     preventscene = 1; # no quick repeats
  525.  
  526.     # Swing camera to frame tunnel and Indy...    
  527.     if (camexists == 0)
  528.     {
  529.         cam1spot = CreateThing(tpl_ghost, player);
  530.         CaptureThing(cam1spot);
  531.         CreateThing(tpl_ghost, player);
  532.         CaptureThing(cam1look);
  533.         camexists = 1;
  534.     }    
  535.     MakeCamera2LikeCamera1(cam1spot, cam1look);
  536.     SetCameraLookInterp(2, 0);
  537.     SetCameraPosInterp(2, 0);
  538.     SetCameraInterpSpeed(2, 0.8);
  539.     SetCameraFocus(2, cam1spot);
  540.     SetCameraSecondaryFocus(2, cam1look);
  541.     SetCurrentCamera(2);
  542.     SetCameraFOV(viewangle, 0, 0.0);
  543.     SetCameraLookInterp(2, 1);
  544.     SetCameraPosInterp(2, 1);
  545.     Sleep(0.01);
  546.     SetCameraFocus(2, cam_3);
  547.     SetCameraSecondaryFocus(2, ct_1);
  548.     Sleep(0.3);
  549.  
  550.     # Sparkle again...
  551.     SetMaterialCel(sparkmat, 0);
  552.     AnimateSpriteSize(sparkle, '0.01 0.01 0.0', '0.2 0.2 1.0', .25);
  553.     MaterialAnim(sparkmat, 20, 1);
  554.     Sleep(0.25);
  555.     SetThingFlags(sparkle, 0x10); # no see
  556.     AnimateSpriteSize(sparkle, '0.2 0.2 1.0', '0.01 0.01 0.0', .25);
  557.     Sleep(0.25);
  558.     ClearThingFlags(sparkle, 0x10); # visible again
  559.  
  560.  
  561.     if (cluetalk == 0)
  562.     {
  563.         # 2nd time thru...
  564.         newline = 2; # force "Something's over there...what is it?"
  565.         oldline = 0;
  566.         call randcluelines;
  567.         cluetalk = 1;
  568.     }
  569.     else
  570.     {
  571.         # 3rd time & thereafter...
  572.         call randcluelines;
  573.     }
  574.  
  575.     whichcam = cam_1; # set here in case of early return
  576.  
  577.     # Kid will not appear until hyenas are gone...
  578.     if (global8 >= 11)
  579.     {
  580.         if (cutSceneState == 5)
  581.         {
  582.             # Prep...
  583.             entercam = cam_12;
  584.  
  585.             # Nukid descends the slope...
  586.             call nukidenter;
  587.  
  588.             # They face each other...
  589.             SetThingMaxRotVel(indy, 150.0);
  590.             AISetLookThing(indy, nu_mk_2);
  591.             Sleep(0.5);
  592.             AISetLookThing(nukid, nu_mk_3); # aim his head high
  593.             AIWaitForStop(nukid);
  594.             DetachThing(kidCamTarget);
  595.             
  596.             curSound =     PlayVoice(nukid, nu_mywatch, 1, 0);
  597.             WaitForSound(curSound);
  598.  
  599.             call exchange;
  600.         }
  601.  
  602.         if (cutSceneState == 3 || cutSceneState == 4)
  603.         {
  604.             call thirdvisit;
  605.         }
  606.         
  607.         if (cutSceneState == 2)
  608.         {
  609.             call secondvisit;
  610.         }
  611.  
  612.         if (cutSceneState == 1)
  613.         {
  614.             call firstvisit;
  615.         }
  616.     }
  617.  
  618.     # Housekeeping...    
  619.     SetCameraPosition(1, GetThingPos(whichcam));
  620.     SetCurrentCamera(curCam);
  621.     RestoreExtCam();
  622.  
  623.     return;
  624.  
  625. # ..............................................................................
  626.  
  627. firstvisit:
  628.     
  629.     # Continue with kid...
  630.     cutSceneState = 2;
  631.     entercam = cam_5;
  632.     call nukidenter;
  633.  
  634.     # Nukid: "Thanks to English...for killing...hyenas."
  635.     curSound = PlayVoice(nukid, nu_thanks, 1, 0);
  636.     AISetLookThing(nukid, nu_mk_3); # aim his head high
  637.  
  638.     # Indy turns to spot the kid's approach...
  639.     SetThingMaxRotVel(indy, 150.0);
  640.     AISetLookThing(indy, nu_mk_2);
  641.     Sleep(0.5);
  642.  
  643.     # Camera moves in on the pair...
  644.     SetCameraInterpSpeed(2, 12.0);
  645.     SetCameraLookInterp(2, 1);
  646.     Sleep(0.01);
  647.     SetCameraFocus(2, cam_6);
  648.     SetCameraSecondaryFocus(2, ct_3);
  649.     SetCameraFOV(45, 1, 12.0);
  650.  
  651.     # They face each other...
  652.     AISetLookThing(nukid, nu_mk_3); # aim his head high
  653.     AIWaitForStop(nukid);
  654.     looker = nukid;
  655.     lookee = nu_mk_3;
  656.     SetPulse(0.1);
  657.     WaitForSound(curSound);
  658.     SetPulse(0);
  659.  
  660.     # Indy: "American..."
  661.     curSound = PlayVoice(indy, in_american, 1, 0);
  662.     PlayKey(indy, in_botharmsup, 4, 0x12, 0);
  663.     WaitForSound(curSound);
  664.  
  665.     # Nukid: "Civilized like English, yes?"
  666.     curSound = PlayVoice(nukid, nu_civilized, 1, 0);
  667.     WaitForSound(curSound);
  668.  
  669.     # Indy: "Don't be too sure."
  670.     curSound = PlayVoice(indy, in_toosure, 1, 0);
  671.     in_keyTrack1 = PlayKey(indy, in_handsONhips, 2, 0x10, 0);
  672.     PlayKey(indy, in_handsTOhips, 4, 0x12, 0);
  673.     WaitForSound(curSound);
  674.  
  675.     # Nukid: "Industrialized too...here to re-open the mines!"
  676.     curSound = PlayVoice(nukid, nu_industrialized, 1, 0);
  677.     Sleep(3.5);
  678.     StopKey(indy, in_keyTrack1, 0.5);
  679.     WaitForSound(curSound);
  680.     
  681.     # Indy turns to look back toward the tunnel...
  682.     SetThingMaxRotVel(indy, 150.0);
  683.     AISetLookThing(indy, in_mk_2);
  684.     
  685.     # Indy: "I think there's something over there I need...want to help me...?"
  686.     curSound = PlayVoice(indy, in_helpme, 1, 0);
  687.     AIWaitForStop(indy);
  688.     Sleep(0.5);
  689.     PlayKey(indy, in_ltarmup, 4, 0x12, 0);
  690.     WaitForSound(curSound);
  691.  
  692.     # Push in on kid...
  693.     SetCameraInterpSpeed(2, 7.0);
  694.     SetCameraFocus(2, cam_8);
  695.     SetCameraSecondaryFocus(2, ct_4);
  696.     SetCameraFOV(42, 1, 7.0);
  697.  
  698.     # Nukid: "That chap Horner was very industrialized...King Sol's mines..."
  699.     curSound = PlayVoice(nukid, nu_chaphorner, 1, 0);
  700.     WaitForSound(curSound);
  701.         
  702.     # Cut to Indy over kid's shoulder...
  703.     SetCameraLookInterp(2, 0);
  704.     SetCameraPosInterp(2, 0);
  705.     SetCameraFocus(2, cam_7);
  706.     SetCameraSecondaryFocus(2, ct_5);
  707.     SetCameraFOV(35, 0, 0.0);
  708.     
  709.     # Indy faces kid again...
  710.     SetThingMaxRotVel(indy, 150.0);
  711.     AISetLookThing(indy, nukid);
  712.     
  713.     # Indy: "Those mines are a myth...help or not?"
  714.     curSound = PlayVoice(indy, in_myth, 1, 0);
  715.     WaitForSound(curSound);
  716.  
  717.     # Nukid: "What if there's something I need...help me?"
  718.     curSound = PlayVoice(nukid, nu_ineed, 1, 0);
  719.     nu_keyTrack1 = PlayKey(nukid, nu_handsONhips, 2, 0x10, 0);
  720.     PlayKey(nukid, nu_handsTOhips, 4, 0x12, 1);
  721.     Sleep(0.8);
  722.     StopKey(nukid, nu_keyTrack1, 0.0);
  723.     PlayKey(nukid, nu_handsTOside, 4, 0x12, 0);
  724.     WaitForSound(curSound);
  725.  
  726.     # Cut to close-up of Indy...
  727.     SetThingFlags(nukid, 0x10); # invisible in this shot
  728.     SetCameraFocus(2, cam_9);
  729.     SetCameraSecondaryFocus(2, ct_6);
  730.     SetCameraFOV(35, 0, 0.0);
  731.     
  732.     # Indy: "Maybe...I don't do miracles..."
  733.     curSound = PlayVoice(indy, in_miracles, 1, 0);
  734.     AISetLookThing(indy, in_mk_3);
  735.     in_keyTrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  736.     PlayKey(indy, in_crossarms, 4, 0x12, 0);
  737.     WaitForSound(curSound);
  738.  
  739.     # Cut to close-up of kid...
  740.     ClearThingFlags(nukid, 0x10); # see kid again
  741.     SetCameraLookInterp(2, 0);
  742.     SetCameraPosInterp(2, 0);
  743.     SetCameraFocus(2, cam_10);
  744.     SetCameraSecondaryFocus(2, ct_7);
  745.     SetCameraFOV(50, 0, 0.0);
  746.     WaitForSound(curSound);
  747.     
  748.     # Nukid: "I have observed...men wear watches...now if I had a watch..."
  749.     curSound = PlayVoice(nukid, nu_observed, 1, 0);
  750.     Sleep(1.5);
  751.     PlayKey(nukid, nu_wearwatch, 4, 0x12, 0);
  752.     WaitForSound(curSound);
  753.  
  754.     DetachThing(kidCamTarget); # no longer needed here
  755.  
  756.     if (GetInv(player, hornerwatch) == 1)
  757.     ##if (1) #### TEST ONLY!
  758.     {
  759.         # If Indy has watch, complete transaction right now...
  760.  
  761.         StopKey(indy, in_keyTrack1, 0.0);
  762.         call exchange;
  763.  
  764.         return;
  765.     }
  766.         
  767.     # Position target...
  768.     TeleportThing(kidCamTarget, ct_8); # move to ref spot
  769.     
  770.     # Cut back to wide shot of pair...
  771.     SetCameraFocus(2, cam_11);
  772.     SetCameraSecondaryFocus(2, kidCamTarget);
  773.     SetCameraFOV(75, 0, 0.0);
  774.     
  775.     # Indy: "Sorry, kid.  I have no idea what time it is."
  776.     curSound = PlayVoice(indy, in_sorrykid, 1, 0);
  777.     StopKey(indy, in_keyTrack1, 0.5);
  778.     WaitForSound(curSound);
  779.  
  780.     # Nukid: "I'll wait while you find out."
  781.     curSound = PlayVoice(nukid, nu_illwait, 1, 0);
  782.     WaitForSound(curSound);
  783.  
  784.     # Nukid exits...
  785.     AttachThingToThing(kidCamTarget, nukid);
  786.     SetCameraFOV(35, 1, 5.0);
  787.     call nukidexit;
  788.  
  789.     # update kidstatus global value
  790.     global3 = 2;
  791.  
  792.     # Housekeeping...
  793.     whichcam = cam_6;
  794.  
  795.     return;
  796.  
  797. # ..............................................................................
  798.  
  799. secondvisit:
  800.  
  801.     # Prep...
  802.     cutSceneState = 3;
  803.     entercam = cam_12;
  804.  
  805.     # Nukid descends the slope...
  806.     call nukidenter;
  807.  
  808.     # They face each other...
  809.     SetThingMaxRotVel(indy, 150.0);
  810.     AISetLookThing(indy, nu_mk_2);
  811.     Sleep(0.5);
  812.     AISetLookThing(nukid, nu_mk_3); # aim his head high
  813.     AIWaitForStop(nukid);
  814.     
  815.     curSound = PlayVoice(indy, in_youagain, 1, 0);
  816.     WaitForSound(curSound);
  817.  
  818.     curSound = PlayVoice(nukid, nu_mywatch, 1, 0);
  819.     WaitForSound(curSound);
  820.  
  821.     curSound = PlayVoice(indy, in_cantfind, 1, 0);
  822.     WaitForSound(curSound);
  823.  
  824.     curSound =     PlayVoice(nukid, nu_andyoucall, 1, 0);
  825.     WaitForSound(curSound);
  826.         
  827.     # Kid exits...
  828.     SetCameraFOV(35, 1, 5.0);
  829.     call nukidexit;        
  830.  
  831.     # Housekeeping...
  832.     whichcam = cam_5;
  833.  
  834.     return;
  835.  
  836. # ..............................................................................
  837.  
  838. thirdvisit:
  839.  
  840.     # Prep...
  841.     cutSceneState = 4;
  842.     entercam = cam_12;
  843.  
  844.     # Nukid descends the slope...
  845.     call nukidenter;
  846.  
  847.     # They face each other...
  848.     SetThingMaxRotVel(indy, 150.0);
  849.     AISetLookThing(indy, nu_mk_2);
  850.     Sleep(0.5);
  851.     AISetLookThing(nukid, nu_mk_3); # aim his head high
  852.     AIWaitForStop(nukid);
  853.     DetachThing(kidCamTarget);
  854.     
  855.     curSound =     PlayVoice(nukid, nu_helloamerican, 1, 0);
  856.     WaitForSound(curSound);
  857.  
  858.     curSound =     PlayVoice(indy, in_nowatch, 1, 0);
  859.     WaitForSound(curSound);
  860.  
  861.     curSound = PlayVoice(nukid, nu_donteventry, 1, 0);
  862.     WaitForSound(curSound);
  863.         
  864.     # Nukid exits...
  865.     SetThingMaxRotVel(indy, 150.0);
  866.     call nukidexit;
  867.     AISetLookThing(indy, ct_1);
  868.     AIWaitForStop(indy);
  869.         
  870.     # Housekeeping...
  871.     whichcam = cam_11;
  872.  
  873.     return;
  874.  
  875. # ..............................................................................
  876.  
  877. nukidenter:
  878.     # play music for kid
  879.     PlaySoundLocal(kidmusic, .6, 0, 0, 0);
  880.  
  881.     # Cut to up-angle on Nubian Kid...
  882.     SetCameraLookInterp(2, 0);
  883.     SetCameraPosInterp(2, 0);
  884.     SetCameraFocus(2, cam_4);
  885.     SetCameraSecondaryFocus(2, kidCamTarget);
  886.     SetCurrentCamera(2);
  887.     SetCameraFOV(25, 0, 0.0);
  888.  
  889.     # Spot Indy on his mark while offscreen...
  890.     CopyOrientAndPos(in_mk_1, indy);
  891.  
  892.     # Kid appears at edge of pit...
  893.     ClearThingFlags(nukid, 0x10); # show kid
  894.     AISetLookThing(nukid, nu_mk_1);
  895.     AISetMoveThing(nukid, nu_mk_1, 0);
  896.     AIWaitForStop(nukid);
  897.  
  898.     # Kid slides down and joins Indy...
  899.     AttachThingToThing(kidCamTarget, nukid);
  900.     Sleep(0.01);
  901.     AISetLookThing(nukid, nu_mk_2);
  902.     AISetMoveThing(nukid, nu_mk_2, 0);
  903.     ClearThingFlags(nukid, 0x4000); # shadow off
  904.  
  905.     SetCameraInterpSpeed(2, 2.5);
  906.     SetCameraPosInterp(2, 1);
  907.     Sleep(0.01);
  908.     SetCameraFocus(2, entercam); # cam varies depending on visit num
  909.     SetCameraFOV(75, 1, 3.5);
  910.     Sleep(2.3);
  911.     SetThingFlags(nukid, 0x4000); # shadow on
  912.     Sleep(1.2);
  913.  
  914.     return;
  915.  
  916. # ..............................................................................
  917.  
  918. nukidexit:
  919.     
  920.     # Track Nukid to slope...
  921.     AISetLookThing(nukid, nu_mk_4);
  922.     AISetMoveThing(nukid, nu_mk_4, 0);
  923.     Sleep(0.5);
  924.     AISetLookThing(indy, nukid);
  925.     Sleep(1.4);
  926.     AISetLookThing(indy, nukid);
  927.     AIWaitForStop(nukid);
  928.     
  929.     if (cutSceneState != 4)
  930.     {
  931.         # Nukid scrambles back up slope...
  932.         nu_keyTrack1 = PlayKey(nukid, nu_scramble, 4, 0x10, 0);
  933.         v_targetpos = GetThingPos(nu_mk_1);
  934.         MoveThingToPos(nukid, v_targetpos, 4.0);
  935.         ClearThingFlags(nukid, 0x4000); # shadow off
  936.  
  937.         # Orient Indy offscreen...
  938.         AISetLookThing(indy, nu_mk_1);
  939.         Sleep(3.3);
  940.         SetThingFlags(nukid, 0x4000); # shadow on
  941.     }
  942.  
  943.     return;
  944.         
  945. # ..............................................................................
  946.  
  947. exchange:
  948.     
  949.     # Cut to shot of kid over Indy's shoulder...
  950.     SetCameraLookInterp(2, 0);
  951.     SetCameraPosInterp(2, 0);
  952.     SetCameraFocus(2, cam_13);
  953.     SetCameraSecondaryFocus(2, ct_9);
  954.     SetCameraFOV(50, 0, 0.0);
  955.  
  956.     # Indy holds up the watch...
  957.     in_swapItem1 = SetThingMesh(indy, 12, mod_in_watchhand, 0);
  958.     PlayKey(indy, in_displaywatch, 4, 0x12, 0);
  959.     Sleep(0.4);
  960.  
  961.     # Nukid gasps...
  962.     curSound =     PlayVoice(nukid, nu_ahhhh, 1, 0);
  963.  
  964.     # Nukid reaches for watch...
  965.     PlayKey(nukid, nu_reachforwatch, 4, 0x12, 0);
  966.     WaitForSound(curSound);
  967.  
  968.     # Indy: "Hey, not so fast."
  969.     curSound =     PlayVoice(indy, in_notsofast, 1, 0);
  970.     WaitForSound(curSound);
  971.     Sleep(0.5);
  972.  
  973.     # Nukid moves past Indy...
  974.     ClearAdjoinFlags(railface, 0x02); # walk on air
  975.     AISetMoveSpeed(nukid, 1.7);
  976.     AISetLookThing(nukid, nu_mk_6);
  977.     AISetMoveThing(nukid, nu_mk_6, 0);
  978.     SetThingMaxRotVel(indy, 150.0);
  979.     AISetLookThing(indy, in_mk_2);
  980.     SetCameraFOV(65, 1, 2.0);
  981.     Sleep(0.5);
  982.     AISetLookThing(nukid, nu_mk_7a);
  983.     AISetMoveThing(nukid, nu_mk_7a, 0);
  984.     Sleep(0.7);
  985.     AISetLookThing(indy, gem);
  986.     AIWaitForStop(nukid);
  987.     AISetLookThing(nukid, nu_mk_8a);
  988.     
  989.     # Cut to shot of kid on the rail...
  990.     SetCameraFocus(2, cam_17);
  991.     SetCameraSecondaryFocus(2, ct_12);
  992.     ClearThingFlags(nukid, 0x4000); # shadow off
  993.     
  994.     # Nukid teeters across...
  995.     AttachThingToThing(ct_12, nukid);
  996.     nu_keyTrack1 = PlayKey(nukid, nu_railslow, 4, 0x10, 0);
  997.     v_targetpos = GetThingPos(nu_mk_8a);
  998.     nu_keyTrack2 = MoveThingToPos(nukid, v_targetpos, 6.0);
  999.     SetCameraFOV(80, 1, 6.0);
  1000.     Sleep(6.0);
  1001.  
  1002.     # Cut to kid approaching gem...
  1003.     SetCameraLookInterp(2, 0);
  1004.     SetCameraPosInterp(2, 0);
  1005.     SetCameraFocus(2, cam_15);
  1006.     SetCameraSecondaryFocus(2, ct_11);
  1007.     SetCameraFOV(70, 0, 0.0);
  1008.     StopKey(nukid, nu_keyTrack1, 0.0);
  1009.     StopAnim(nu_keyTrack2);
  1010.  
  1011.     # TO DO: fix MoveThingToPos bug that doesn't reset the physics flags...
  1012.     ClearPhysicsFlags(nukid, 0x800000);
  1013.  
  1014.     SetThingFlags(nukid, 0x4000); # shadow on
  1015.     AttachThingToThing(cam_15, nukid);
  1016.     AttachThingToThing(ct_11, nukid);
  1017.     AISetMoveSpeed(nukid, 1.5);
  1018.     AISetLookThing(nukid, gem);
  1019.     AISetMoveThing(nukid, nu_mk_9, 0);
  1020.     Sleep(2.5);
  1021.  
  1022.     # One last sparkle...
  1023.     SetMaterialCel(sparkmat, 0);
  1024.     AnimateSpriteSize(sparkle, '0.01 0.01 0.0', '0.2 0.2 1.0', .25);
  1025.     MaterialAnim(sparkmat, 20, 1);
  1026.     Sleep(0.2);
  1027.     SetThingFlags(sparkle, 0x10); # no see
  1028.     AnimateSpriteSize(sparkle, '0.2 0.2 1.0', '0.01 0.01 0.0', .25);
  1029.     AIWaitForStop(nukid);
  1030.  
  1031.     # Nukid grabs gem...
  1032.     swapevent = 1;
  1033.     PlayKey(nukid, nu_grabgem, 4, 0x12, 1); # anim triggers callback
  1034.     # Sleep(1.0);
  1035.         
  1036.     # Nukid starts back...
  1037.     AISetMoveSpeed(nukid, 1.5);
  1038.     AISetLookThing(nukid, nu_mk_8b);
  1039.     AISetMoveThing(nukid, nu_mk_8b, 0);
  1040.     AIWaitForStop(nukid);
  1041.     
  1042.     # Cut to reverse shot framing Indy and Nukid...
  1043.     SetCameraFocus(2, cam_14);
  1044.     SetCameraSecondaryFocus(2, ct_10);
  1045.     SetCameraFOV(75, 0, 0.0);
  1046.     SetThingMaxRotVel(indy, 180.0);
  1047.     AISetLookThing(indy, nu_mk_8b);
  1048.  
  1049.     # Nukid teeters back...
  1050.     nu_keyTrack1 = PlayKey(nukid, nu_railslow, 4, 0x10, 0);
  1051.     v_targetpos = GetThingPos(nu_mk_7b);
  1052.     nu_keyTrack2 = MoveThingToPos(nukid, v_targetpos, 6.0);
  1053.     SetCameraInterpSpeed(2, 6.0);
  1054.     SetCameraLookInterp(2, 1);
  1055.     SetCameraPosInterp(2, 1);
  1056.     Sleep(1.0);
  1057.     ClearThingFlags(nukid, 0x4000); # shadow off
  1058.     AISetLookThing(indy, nu_mk_7b);
  1059.     Sleep(0.5);
  1060.     SetCameraFocus(2, cam_16);
  1061.     SetCameraSecondaryFocus(2, ct_14);
  1062.     SetCameraFOV(65, 1, 6.0);
  1063.     Sleep(4.5);
  1064.     StopKey(nukid, nu_keyTrack1, 0.0);
  1065.     StopAnim(nu_keyTrack2);
  1066.  
  1067.     # TO DO: fix MoveThingToPos bug that doesn't reset the physics flags...
  1068.     ClearPhysicsFlags(nukid, 0x800000);
  1069.  
  1070.     # Nukid rejoins Indy...
  1071.     AISetLookThing(nukid, nu_mk_6);
  1072.     AISetMoveThing(nukid, nu_mk_6, 0);
  1073.     SetThingFlags(nukid, 0x4000); # shadow on
  1074.     SetThingMaxRotVel(indy, 150.0);
  1075.     Sleep(0.5);
  1076.     AISetLookThing(indy, nu_mk_6);
  1077.     AIWaitForStop(nukid);
  1078.  
  1079.     # Indy and Nukid exchange items...
  1080.     AISetLookThing(nukid, indy);
  1081.     AISetLookThing(indy, nukid);
  1082.     AIWaitForStop(nukid);
  1083.     swapevent = 2; # gem swap
  1084.     PlayKey(nukid, nu_givegem, 4, 0x12, 0); # anim triggers callback
  1085.     PlayKey(indy, in_takegem, 4, 0x12, 0); # anim triggers callback
  1086.     Sleep(1.0);
  1087.     swapevent = 3; # put away gem
  1088.  
  1089.     # Inventory: gain gem (right hands)...
  1090.     ChangeInv(player, gemeye, 1.0);
  1091.     SetInvAvailable(player, gemeye, 1);
  1092.     JonesInvItemChanged(gemeye);
  1093.     Sleep(2.0);
  1094.  
  1095.     # Inventory: lose watch (left hand to right hand)...
  1096.     ChangeInv(player, hornerwatch, -1.0);
  1097.     swapevent = 4; # watch swap
  1098.     PlayKey(nukid, nu_getwatch, 4, 0x12, 0); # animation triggers callback
  1099.     PlayKey(indy, in_givewatch, 4, 0x12, 0);
  1100.     Sleep(0.5);
  1101.  
  1102.     # Indy: "Take good care...belonged...to man who discovered...mines."
  1103.     curSound =     PlayVoice(indy, in_goodcare, 1, 0);
  1104.     Sleep(1.0);
  1105.     in_keyTrack1 = PlayKey(indy, in_handsONhips, 2, 0x10, 0);
  1106.     PlayKey(indy, in_handsTOhips, 4, 0x12, 0);
  1107.     WaitForSound(curSound);
  1108.  
  1109.     # Cut to angle on kid...
  1110.     SetCameraLookInterp(2, 0);
  1111.     SetCameraPosInterp(2, 0);
  1112.     SetCameraFocus(2, cam_18);
  1113.     SetCameraSecondaryFocus(2, ct_13);
  1114.     SetCameraFOV(50, 0, 0.0);
  1115.  
  1116.     # Nukid: "Now I own a machine!  I am industrialized!"
  1117.     curSound =     PlayVoice(nukid, nu_nowiown, 1, 0);
  1118.     PlayKey(nukid, nu_industry, 4, 0x12, 0);
  1119.     WaitForSound(curSound);
  1120.  
  1121.     # Indy: "It's a start."
  1122.     curSound =     PlayVoice(indy, in_astart, 1, 0);
  1123.     PlayKey(indy, in_pushhat, 4, 0x12, 0);
  1124.     WaitForSound(curSound);
  1125.     
  1126.     # Nukid scampers away up the slope...
  1127.     AttachThingToThing(ct_13, nukid);
  1128.     AISetMoveSpeed(nukid, 1.5);
  1129.     AISetLookThing(nukid, nu_mk_4);
  1130.     AISetMoveThing(nukid, nu_mk_4, 0);
  1131.     StopKey(indy, in_keyTrack1, 0.5);
  1132.     AIWaitForStop(nukid);
  1133.     nu_keyTrack1 = PlayKey(nukid, nu_scramwatch, 4, 0x10, 0);
  1134.     v_targetpos = GetThingPos(nu_mk_1);
  1135.     nu_keyTrack2 = MoveThingToPos(nukid, v_targetpos, 4.0);
  1136.     ClearThingFlags(nukid, 0x4000); # shadow off
  1137.     
  1138.     # Orient Indy offscreen...
  1139.     AISetLookThing(indy, nu_mk_1);
  1140.     Sleep(3.3);
  1141.  
  1142.     # Cut to kid at top of slope...
  1143.     SetThingFlags(nukid, 0x10);
  1144.     SetThingFlags(badpost, 0x10);   #10/16/99  RKD: Hide the post hogging the scene
  1145.     StopKey(nukid, nu_keyTrack1, 0.0);
  1146.     StopAnim(nu_keyTrack2);
  1147.     StopThing(nukid);
  1148.     ResetThing(nukid);
  1149.     SetCameraFocus(2, cam_19);
  1150.     SetCameraSecondaryFocus(2, ct_15);
  1151.     SetCameraFOV(50, 0, 0.0);
  1152.     TeleportThing(nukid, nu_mk_10);
  1153.     ClearThingFlags(nukid, 0x10);
  1154.     SetThingFlags(nukid, 0x4000); # shadow on
  1155.  
  1156.     # add in the conveyor rattle
  1157.     cursound2 = PlaySoundLocal(rattle, .2, 0, 1, 0);
  1158.     
  1159.     # Nukid turns back toward Indy...
  1160.     AISetLookThing(nukid, indy);
  1161.     AIWaitForStop(nukid);
  1162.     PlayKey(nukid, nu_factory, 4, 0x12, 0);
  1163.  
  1164.     # Nukid: "Today at 11...I leave for Kenya...soon...factory."
  1165.     curSound =     PlayVoice(nukid, nu_kenya, 1, 0);
  1166.     
  1167.     # TO DO: fix MoveThingToPos bug that doesn't reset the physics flags...
  1168.     ClearPhysicsFlags(nukid, 0x800000);
  1169.  
  1170.     WaitForSound(curSound);
  1171.     AISetLookThing(nukid, nu_mk_11);
  1172.     Sleep(0.5);
  1173.     AISetMoveThing(nukid, nu_mk_11, 0);
  1174.     Sleep(2.0);
  1175.  
  1176.     # Housekeeping...
  1177.     SetAdjoinFlags(railface, 0x02);
  1178.     whichcam = ct_9;    
  1179.     cutSceneState = 6; # this scene will never run again
  1180.     
  1181.     # update kidstatus global
  1182.     global3 = 3;
  1183.  
  1184.        # kill the rattle
  1185.     StopSound(curSound2, .5);
  1186.  
  1187.     return;
  1188.  
  1189. # ..............................................................................
  1190.  
  1191. generalprep:
  1192.  
  1193.     alreadyworking = 1;
  1194.     StartCutScene(1);
  1195.     SetActorFlags(player, 0x200000);
  1196.     ResetCameraFOV(0, 0.0);
  1197.     curCam = GetCurrentCamera();
  1198.     
  1199.     # Prep kid offscreen...
  1200.     ClearThingFlags(nukid, 0x80000);
  1201.     SetThingFlags(nukid, 0x10); # present but invisible
  1202.     AISetCutsceneMode(nukid);
  1203.     CopyOrientAndPos(nu_mk_5, nukid);
  1204.  
  1205.     # Make a target...
  1206.     kidCamTarget = CreateThing(tpl_ghost, ct_2); # dupe ref target & frame
  1207.     CaptureThing(kidCamTarget);
  1208.  
  1209.     # TO DO: let player finish any move, then stop & stand him...
  1210.  
  1211.     ResetThing(player);
  1212.     PlayMode(player, 1, 0);
  1213.     DeselectWeaponWait(player);
  1214.     CopyPlayerHolsters(player, indy);
  1215.     SetThingflags(player, 0x80000);
  1216.     CopyOrientAndPos(player, indy);
  1217.     ClearThingFlags(indy, 0x80000);
  1218.  
  1219.     return;
  1220.  
  1221. # ..............................................................................
  1222.  
  1223. backtoplay:
  1224.  
  1225.     # Clean up...
  1226.     SetThingMaxRotVel(indy, in_rotRate);
  1227.     SetThingMaxRotVel(nukid, nu_rotRate);
  1228.     CopyOrientAndPos(indy, player);
  1229.     SetCameraLookInterp(2, 0);
  1230.     SetCameraPosInterp(2, 0);
  1231.     ResetCameraFOV(0, 0.0);        #10/15/99 RKD - wasn't resetting camera 2
  1232.     SetCurrentCamera(curCam);
  1233.     ResetCameraFOV(0, 0.0);
  1234.  
  1235.     # put post back in place
  1236.     ClearThingFlags(badpost, 0x10);   #RKD - put the post back
  1237.     
  1238.     # Reset kid...
  1239.     if (cutSceneState == 6)
  1240.     {
  1241.         DestroyThing(nukid);
  1242.     }
  1243.     else
  1244.     {
  1245.         StopKey(nukid, nu_keyTrack1, 0.0);
  1246.         ResetThing(nukid);
  1247.         SetThingFlags(nukid, 0x80000);
  1248.     }
  1249.  
  1250.     # Zap target...
  1251.     DestroyThing(kidCamTarget);
  1252.  
  1253.     # Restore control...
  1254.     SetThingFlags(nukid, 0x80000);
  1255.     SetThingflags(indy, 0x80000);
  1256.     ClearThingFlags(player, 0x80000);
  1257.     ClearActorFlags(player, 0x200000);
  1258.     EndCutScene();
  1259.     alreadyworking = 0;
  1260.  
  1261.     return;
  1262.  
  1263. # ...................................................................
  1264.  
  1265. callback:
  1266.  
  1267.     if (swapevent == 1)
  1268.     {
  1269.         # Nukid takes gem...
  1270.         nu_swapItem1 = SetThingMesh(nukid, 5, mod_nu_gemhand, 0);
  1271.         swapevent = 0; # reset
  1272.  
  1273.         # Turn off the gem and sparkle...
  1274.         SetThingFlags(gem, 0x10);
  1275.         SetThingFlags(sparkle, 0x10);
  1276.     }
  1277.  
  1278.     if (swapevent == 2)
  1279.     {
  1280.         # Kid gives up gem...
  1281.         RestoreThingMesh(nukid, nu_swapItem1);
  1282.         # Indy takes gem...
  1283.         in_swapItem2 = SetThingMesh(indy, 15, mod_in_gemhand, 0);
  1284.         swapevent = 0; # reset
  1285.     }
  1286.  
  1287.     if (swapevent == 3)
  1288.     {
  1289.         # Indy puts gem away...
  1290.         RestoreThingMesh(indy, in_swapItem2);
  1291.         swapevent = 0; # reset
  1292.     }
  1293.  
  1294.     if (swapevent == 4)
  1295.     {
  1296.         # Nukid takes watch...
  1297.         RestoreThingMesh(indy, in_swapItem1);
  1298.         nu_swapItem2 = SetThingMesh(nukid, 5, mod_nu_watchhand, 0);
  1299.         swapevent = 0; # reset
  1300.     }
  1301.  
  1302.     return;
  1303.  
  1304. # ...................................................................
  1305.  
  1306. pulse:
  1307.  
  1308.     SetThingHeadLookThing(looker, lookee);
  1309.  
  1310.     return;
  1311.  
  1312. # ...................................................................
  1313.  
  1314. randcluelines:
  1315.  
  1316.     while (newline == oldline)
  1317.     {
  1318.         newline = RandBetween(0, 9); # 1/10 chance for line 0
  1319.         if (newline != 0)
  1320.         {        
  1321.             newline = RandBetween(1, 3); # ~1/3 chance for lines 1 thru 3
  1322.         }
  1323.     }
  1324.     oldline = newline;
  1325.  
  1326.     PlayVoice(indy, in_sayline[newline], 1, 1);
  1327.         
  1328.     return;
  1329.  
  1330. end
  1331.